package yyee.llee.mmee.viewmode

import androidx.lifecycle.MutableLiveData
import com.google.gson.Gson
import yyee.llee.mmee.base_api_net.base_api_bean.bean.Citys
import yyee.llee.mmee.pl190.host668.StrongContext
import yyee.llee.mmee.weather.repository.WeatherRepository

class SearchViewModel : BaseViewModel() {

    val hotCity = MutableLiveData<Citys>()
    val searchCity = MutableLiveData<ArrayList<Citys>>()
    private val weatherRepository = WeatherRepository()

    /**
     * 获取热门城市
     */
    fun getHopCity() {
        launch {
            val cityList: Citys = Gson().fromJson(
                bi.GD.getJson(
                    "hot_city.json",
                    StrongContext.getContext()
                ),
                Citys::class.java
            )

            hotCity.postValue(cityList)
        }
    }


}